home *** CD-ROM | disk | FTP | other *** search
- Path: airdmhor.gen.nz!brage
- From: brage@PROBLEM_WITH_INEWS_DOMAIN_FILE (Aaron Hicks)
- Newsgroups: comp.lang.c++
- Subject: Help with svgalib and arrays.
- Date: 4 Feb 1996 05:06:44 GMT
- Organization: Airdmhor
- Message-ID: <4f1et4$vdr@airdmhor.gen.nz>
- NNTP-Posting-Host: airdmhor.gen.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- I need help with a so far primitive graphic application, so far all my
- program does is refresh an array to the screen. My problem is that the
- refresh rate is abysmal, about 1.5 frames per second and all it's doing is
- displaying the array to the screen, I've tried it in both G640x480x256 and
- G320x200x256 and has the same frame rate. This, as far as I can tell, means
- that my problem is not with the way I'm displaying the stuff to the screen,
- but with the way I'm retrieving the data from the array.
-
- I'm using GCC under Linux (the November 1995 Infomagic release), the card is
- a Diamond Stealth 64 Video VRAM, with 2MB on board, the computer is a 486DX4
- 100 MHz with 16Mb of memory.
-
- Currently the bits of the program that I find unsatisfactory are...
-
- class dbit {
- int terra,aqua,aura,ether;
- public:
- int colour();
- };
-
- int dbit::colour()
- {
- return (terra);// soon to be replaced by some function of terra
- };
-
- class world {
- dbit maploc[639][479];
- public:
- void show();
- };
-
- void world::show()
- {
- for(y=0;y<=479;y=y+1);{
- for(x=0;x<=639;x=x+1)
- gl_setpixel(x,y,maploc[x][y].colour());
- };
- };
-
- The slow bit seems to be the function world.show(). Main simply sets up the
- display in G640x480x256 and a virtual screen and gl_copyscreens the
- virtual to the physical.
-
-
-
- --
- ###################################################################
- # A message from Bloodrage, (brage@airdmhor.gen.nz), the home of #
- # MegaBBS and Realms of Insanity BBS. Christchurch, New Zealand. #
- # The truth is out there. #
- ###################################################################
-
-